package com.yzi.utilitys
{
	import flash.geom.Point;

	public class CoordinateConverter
	{
		public function CoordinateConverter()
		{
			throw new Error("Static Class");
		}
		
		static public function PolarPoint($origin:Point, $target:Point): Point
		{
			var result:Point = new Point();
			result.x = $target.x - $origin.x;
			result.y = $target.y - $origin.y;
			
			var angle:Number = MathUtility.ToAngle(Math.atan2(result.y, result.x));
			var coordinate:Point = GeometryUtility.Polar(result.length, MathUtility.ToRadian(angle + 180));
			
			result.x = $origin.x + coordinate.x;
			result.y = $origin.y + coordinate.y;
			
			return result;
		}
	}
}